/*
 * Created: 2020-03-08 17:47:47
 * Author : Mockingbird
 * Email : 1768385508@qq.com
 * -----
 * Description:
 */
import { hot } from 'react-hot-loader';
import * as React from 'react';
import { Router } from 'react-router-dom';
import { Provider, observer } from 'mobx-react';
import { renderRoutes } from '../utils/router.config';
import routes from './routes';
import '../i18n';
import '@styles/main.scss';
// 设置antd中文
import { ConfigProvider } from 'antd';
import zhCN from 'antd/es/locale/zh_CN';
interface PropType {
  rootStore: any;
  history: any;
}

@hot(module)
@observer
class App extends React.Component<PropType> {
  render() {
    const { rootStore, history } = this.props;
    return (
      <ConfigProvider locale={zhCN}>
        <Provider rootStore={rootStore}>
          <Router history={history}>{renderRoutes(routes)}</Router>
        </Provider>
      </ConfigProvider>
    );
  }
}
export default App;
